<style lang="less">
	page{
		background: #f6f6f6;
		padding-bottom: 50upx;
	}
	.content {
		text-align: center;
	}
	.main-top{
		background: #FFFFFF;
		box-sizing: border-box;
		position: relative;
		text-align: center;
		.bj{
			display: block;
			width: 100%;
		}
		.main-top-pos{
			position: absolute;
			top: 40upx;
			left: 0;
			width: 100%;
			overflow: hidden;
			padding:0 60upx;
			box-sizing:border-box;
			.touxiang{
				width: 100upx;
				float: left;
				border-radius: 50%;
				height: auto;
			}
			.name{
				float: left;
				margin-left:20upx;
				text-align:left;
				overflow: hidden;
				.name-mingzi{
					font-size:30upx;
					font-weight:bold;
					color:rgba(51,51,51,1);
					line-height:36upx;
				}
				.name-mobile{
					font-size:24upx;
					color:rgba(51,51,51,1);
					line-height:36upx;
				}
				.memberTyp{
					line-height: 36upx;
					border: 2upx solid #000000;
					border-radius: 18upx;
					font-size: 20upx;
					font-weight: bold;
					color: #000000;
					padding: 0 20upx;
					margin-top: 10upx;
					float: left;
					box-sizing: border-box;
				}
				.memberImage{
					width: 250upx;
					height: auto;
				}
			}
			.erweima{
				float: right;
				width: 100upx;
				height: auto;
				max-height: 110upx;
				overflow: hidden;
			}
		}
	}
	.main-list{
		margin-top: 20upx;
		background: #FFFFFF;
	}
	.main-info .main-list:nth-child(1){
		margin:0;
	}
	.main-list-title{
		display: flex;
		justify-content: space-between;
		padding: 0 30upx;
		.main-list-title-fl{
			font-size:30upx;
			font-weight:bold;
			color:rgba(51,51,51,1);
			line-height:90upx;
		}
		.main-list-title-fr{
			font-size:22upx;
			font-weight:500;
			color:rgba(153,153,153,1);
			line-height:90upx;
			display: flex;
			align-items:center;
			.tiaozhuan{
				height: auto;
				width: 40upx;
			}
		}
	}
	.main-list-title.list{
		border-top: 1upx solid #ededed;
	}
	.main-list-title.list:first-child{
		border-top: none;
	}
	.main-list-cen.top{
		.main-list-cen-for{
			width: 25%;
			.erweima{
				width: 56upx;
				height: 56upx;
			}
		}
		.main-list-cen-for:nth-child(3){
			border-right:2upx solid #ededed;
		}
		.main-list-cen-for:nth-child(4){
			border-right:none;
			.name{
				margin: 0;
			}
		}
	}
	.main-list-cen{
		overflow: hidden;
		.main-list-cen-for{
			width: 25%;
			float: left;
			border-top:2upx solid #ededed;
			border-right:2upx solid #ededed;
			box-sizing: border-box;
			color:rgba(51,51,51,1);
			padding: 20upx 0;
			.num{
				font-size:40upx;
				font-family: 'DINCond';
				font-weight:400;
				line-height:48upx;
			}
			.num.tes{
				font-weight:bold;
				color:#c4ae84 ;
			}
			.name{
				font-size:24upx;
				font-weight:500;
				line-height:29upx;
				margin-top: 20upx;
			}
			.name.tes{
				font-weight:bold;
				color:#c4ae84 ;
			}
			.chakan{
				height: 100rpx;
				line-height: 100upx;
			}
		}
		.main-list-cen-for:nth-child(4){
			border-right:none;
		}
		.main-list-cen-for:nth-child(8){
			border-right:none;
		}
	}
	//t弹出二维码
	.pos-img{
		position: fixed;
		width: 100%;
		height: 100%;
		left: 0;
		top: 0;
		z-index: 1000;
		.pos-img-bj{
			position: absolute;
			width: 100%;
			height: 100%;
			left: 0;
			top: 0;
			z-index: 1001;
			background: #000000;
			opacity: 0.3;
		}
		.pos-img-centent{
			position: absolute;
			z-index: 10002;
			width: 560upx;
			left: 50%;
			margin-left: -280upx;
			top: 18%;
			background: #FFFFFF;
			padding: 40upx 70upx;
			border-radius:12upx;
			box-sizing: border-box;
			.gundong{
				height: 500upx;
			}
			.pos-img-centent-img{
				width: 100%;
				height: auto;
				display: block;
			}
			.but{
				font-size:28upx;
				font-weight:500;
				color:rgba(51,51,51,1);
				line-height:46upx;
				text-align: center;
				margin-top: 20upx;
			}
		}
	}
	/*样式的width和height一定要与定义的cWidth和cHeight相对应*/
	.qiun-charts {
		margin-top: 20upx;
		width: 750upx;
		height: 540upx;
		background-color: #FFFFFF;
		padding: 20upx 0;
		.qiun-charts-title{
			font-size:30upx;
			font-weight:bold;
			color:rgba(51,51,51,1);
			line-height:40upx;
		}
	}
	
	.charts {
		width: 750upx;
		height: 500upx;
		background-color: #FFFFFF;
	}
</style>
<template>
	<view class="content">
		<view class="main-top">
			<image src="/static/img/wdfs_bgpics.png" class="bj" mode="widthFix"></image>
			<view class="main-top-pos">
				<image v-if="myTeam.headIco!='' && myTeam.headIco!=null && myTeam.headIco!=undefined" :src= "'https://static.xpandago.net'+'/'+myTeam.headIco" class="touxiang" mode="widthFix"></image>
				<image v-else src='https://static.xpandago.net/wechat/images/logo.png' class="touxiang" mode="widthFix"></image>
				<view class="name">
					<view class="name-mingzi">{{myTeam.username}}</view>
					<view class="name-mobile">{{myTeam.mobile}}</view>
					<view v-if="myTeam.memberTypeStr!='' && myTeam.memberTypeStr!=null && myTeam.memberTypeStr!=undefined" class="memberTyp">{{myTeam.memberTypeStr}}</view>
					<!-- <image v-if="myTeam.memberImage!='' && myTeam.memberImage!=null && myTeam.memberImage!=undefined" :src= "'https://static.xpandago.net'+'/'+myTeam.memberImage" class="memberImage" mode="widthFix"></image> -->
				</view>
				<image v-if="myTeam.weChatCode!='' && myTeam.weChatCode!=null && myTeam.weChatCode!=undefined" @tap.stop="shareShow(0)" :src= "'https://static.xpandago.net'+'/'+myTeam.weChatCode" class="erweima"></image>
				<!-- <image v-else src='https://xpandago.oss-cn-shanghai.aliyuncs.com/applet/zhanweitu.png' class="erweima" mode="widthFix"></image> -->
			</view>
		</view>
		<view class="pos-img" v-if="imgShow==true">
			<view class="pos-img-bj" @tap.stop="shareHide"></view>
			<view class="pos-img-centent">
				<scroll-view scroll-y="true" class="gundong">
					<image :src= "'https://static.xpandago.net'+'/'+img" class="pos-img-centent-img" mode="widthFix"></image>
				</scroll-view>
				<view class="but">长按识别二维码或保存至本地</view>
			</view>
		</view>
		<view class="main-info">
			<view class="main-list" v-if="myTeam.invite != '' && myTeam.invite != null && myTeam.invite != undefined">
				<view class="main-list-title">
					<view class="main-list-title-fl">我的邀约人</view>
				</view>
				<view class="main-list-cen top">
					<view class="main-list-cen-for" v-if="myTeam.invite.userName != '' && myTeam.invite.userName != null && myTeam.invite.userName != undefined">
						<view class="name">{{myTeam.invite.userName}}</view>
						<view class="name">用户名</view>
					</view>
					<view class="main-list-cen-for" v-if="myTeam.invite.mobile != '' && myTeam.invite.mobile != null && myTeam.invite.mobile != undefined">
						<view class="name">{{myTeam.invite.mobile}}</view>
						<view class="name">手机号</view>
					</view>
					<view class="main-list-cen-for" v-if="myTeam.invite.code != '' && myTeam.invite.code != null && myTeam.invite.code != undefined">
						<view class="name">{{myTeam.invite.code}}</view>
						<view class="name">邀请码</view>
					</view>
					<view class="main-list-cen-for">
						<image v-if="myTeam.invite.parentUserWeChatCode != '' && myTeam.invite.parentUserWeChatCode != null && myTeam.invite.parentUserWeChatCode != undefined" @tap.stop="shareShow(1)" :src= "'https://static.xpandago.net'+'/'+myTeam.invite.parentUserWeChatCode" class="erweima"></image>
						<view v-if="myTeam.invite.parentUserWeChatCode != '' && myTeam.invite.parentUserWeChatCode != null && myTeam.invite.parentUserWeChatCode != undefined" class="name">二维码</view>
					</view>
				</view>
			</view>
			<view class="main-list">
				<view class="main-list-title">
					<view class="main-list-title-fl">团队粉丝</view>
				</view>
				<view class="main-list-cen">
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.bigFans}}</view>
						<view class="name">至尊VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.middleFans}}</view>
						<view class="name">金尊VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.smallFans}}</view>
						<view class="name">银尊VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.generalFans}}</view>
						<view class="name">VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.touristFans}}</view>
						<view class="name">注册会员</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num tes">{{group_z}}</view>
						<view class="name tes">总人数</view>
					</view>
					<view class="main-list-cen-for">
						<view class="chakan"></view>
					</view>
					<view class="main-list-cen-for">
						<view class="chakan"></view>
					</view>
				</view>
			</view>
			<view class="main-list">
				<view class="main-list-title">
					<view class="main-list-title-fl">团队核心粉丝</view>
				</view>
				<view class="main-list-cen">
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.teamNewMemberType1}}</view>
						<view class="name">创业家</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.teamNewMemberType2}}</view>
						<view class="name">企业家</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.teamNewMemberType3}}</view>
						<view class="name">名人堂</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.teamNewMemberType4}}</view>
						<view class="name">联合合伙人</view>
					</view>
				</view>
			</view>
			<view class="main-list">
				<uni-segmented-control :current="current" :values="items" :style-type="styleType" :active-color="activeColor" @clickItem="onClickItem" />
				<view class="content">
					<view v-show="current === 0">
						<view class="main-list-cen">
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.todayBigFans}}</view>
								<view class="name">至尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.todayMiddleFans}}</view>
								<view class="name">金尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.todaySmallFans}}</view>
								<view class="name">银尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.todayGeneralFans}}</view>
								<view class="name">VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.todayTouristFans}}</view>
								<view class="name">注册会员</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num tes">{{today_z}}</view>
								<view class="name tes">总人数</view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
						</view>
					</view>
					<view v-show="current === 1">
						<view class="main-list-cen">
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.yesterdayBigFans}}</view>
								<view class="name">至尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.yesterdayMiddleFans}}</view>
								<view class="name">金尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.yesterdaySmallFans}}</view>
								<view class="name">银尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.yesterdayGeneralFans}}</view>
								<view class="name">VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.yesterdayTouristFans}}</view>
								<view class="name">注册会员</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num tes">{{myTeam.yesterdayBigFans+myTeam.yesterdayMiddleFans+myTeam.yesterdaySmallFans+myTeam.yesterdayGeneralFans+myTeam.yesterdayTouristFans}}</view>
								<view class="name tes">总人数</view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
						</view>
					</view>
					<view v-show="current === 2">
						<view class="main-list-cen">
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisWeekBigFans}}</view>
								<view class="name">至尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisWeekMiddleFans}}</view>
								<view class="name">金尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisWeekSmallFans}}</view>
								<view class="name">银尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisWeekGeneralFans}}</view>
								<view class="name">VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisWeekTouristFans}}</view>
								<view class="name">注册会员</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num tes">{{myTeam.thisWeekBigFans+myTeam.thisWeekMiddleFans+myTeam.thisWeekSmallFans+myTeam.thisWeekGeneralFans+myTeam.thisWeekTouristFans}}</view>
								<view class="name tes">总人数</view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
						</view>
					</view>
					<view v-show="current === 3">
						<view class="main-list-cen">
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisMonthBigFans}}</view>
								<view class="name">至尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisMonthMiddleFans}}</view>
								<view class="name">金尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisMonthSmallFans}}</view>
								<view class="name">银尊VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisMonthGeneralFans}}</view>
								<view class="name">VIP</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num">{{myTeam.thisMonthTouristFans}}</view>
								<view class="name">注册会员</view>
							</view>
							<view class="main-list-cen-for">
								<view class="num tes">{{myTeam.thisMonthBigFans+myTeam.thisMonthMiddleFans+myTeam.thisMonthSmallFans+myTeam.thisMonthGeneralFans+myTeam.thisMonthTouristFans}}</view>
								<view class="name tes">总人数</view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
							<view class="main-list-cen-for">
								<view class="chakan"></view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="main-list">
				<view class="main-list-title">
					<view class="main-list-title-fl">我的粉丝</view>
				</view>
				<view class="main-list-cen">
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.bigNum}}</view>
						<view class="name">至尊VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.middleNum}}</view>
						<view class="name">金尊VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.smallNum}}</view>
						<view class="name">银尊VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.generalNum}}</view>
						<view class="name">VIP</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.touristNum}}</view>
						<view class="name">注册会员</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num tes">{{fans_z}}</view>
						<view class="name tes">总人数</view>
					</view>
					<view class="main-list-cen-for" @tap="fans">
						<view class="chakan">查看团队 ></view>
					</view>
					<view class="main-list-cen-for" @tap="xiangqing">
						<view class="chakan">查看数据 ></view>
					</view>
				</view>
			</view>
			<view class="main-list">
				<view class="main-list-title">
					<view class="main-list-title-fl">我的核心粉丝</view>
				</view>
				<view class="main-list-cen">
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.newMemberType1}}</view>
						<view class="name">创业家</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.newMemberType2}}</view>
						<view class="name">企业家</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.newMemberType3}}</view>
						<view class="name">名人堂</view>
					</view>
					<view class="main-list-cen-for">
						<view class="num">{{myTeam.newMemberType4}}</view>
						<view class="name">联合合伙人</view>
					</view>
				</view>
			</view>
			<view class="qiun-charts">
				<view class="qiun-charts-title">{{mydate}} 直属粉丝新增趋势图</view>
				<canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" disable-scroll=true @touchstart="touchLineA" @touchmove="moveLineA" @touchend="touchEndLineA"></canvas>
			</view>
			<view class="main-list">
				<view class="main-list-title list" @tap="biandong(mydate)">
					<view class="main-list-title-fl">直属粉丝变动记录</view>
					<view class="main-list-title-fr">
						<image src='/static/img/arrow-right@2x.png' class="tiaozhuan" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</view>	
	</view>
</template>

<script>
	import api from '@/common/api';
	import uniSegmentedControl from '@/components/uni-segmented-control/uni-segmented-control.vue'
	import uCharts from '@/components/u-charts/u-charts.js';
	var _self;
	var canvaLineA=null;
	export default {
		components: {
			uniSegmentedControl
		},
		data() {
			return {
				fansFlag:'',  // 判断是xpa     等于1 公众号
				myTeam:{},
				fans_z:'',
				group_z:'',
				today_z:'',
				token:'',
				imgShow:false,
				items: [
					'今日新增',
					'昨日新增',
					'近七天新增',
					'本月新增'
				],
				current: 0,
				colorIndex: 0,
				activeColor: 'rgba(218,193,145,1)',
				styleType: 'text',
				//图表
				mydate:'',
				cWidth:'',
				cHeight:'',
				pixelRatio:1,
			}
		},
		onLoad(options) {
			// console.log(options)
			if(options.fansFlag != '' && options.fansFlag != null && options.fansFlag != undefined){
				this.fansFlag = true
			}
			_self = this;
			this.cWidth=uni.upx2px(750);
			this.cHeight=uni.upx2px(500);
			// 获取当前年月
			var date=new Date;
			 var year=date.getFullYear(); 
			 var month=date.getMonth()+1;
			 month =(month<10 ? "0"+month:month); 
			 this.mydate = (year.toString()+'-'+month.toString());
			 let token=this.getQueryVariable('token');
			this.token=uni.getStorageSync('token')
			let code=this.GetQueryString('code');
			console.log(code)
			var pages = getCurrentPages(); // 当前页面
			var beforePage = pages[pages.length - 1]; // 获取当前页面的对象
			var url = beforePage.route //当前页面url
			uni.setStorageSync('url', url);
			console.log(url,this.token,this.code)
			if(token!=false){
				uni.setStorageSync('token', token);
				this.token=token
				this.myFans()
			}else if(this.token!=null && this.token !='' && this.token != undefined){
				this.myFans()
			}else if(code!=null && code !='' && code != undefined){
				this.loginCode(code)
			}else{
				uni.showToast({
					title: '请先登录！',
					icon: 'none'
				})
				setTimeout(() => {
					uni.reLaunch({
					  url: "/pages/login/loginWechat"
					})
				}, 1000);
			}
		},
		//下拉刷新
		 onPullDownRefresh() {
			//监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
			this.myFans()
			setTimeout(function () {
				uni.stopPullDownRefresh();  //停止下拉刷新动画
			}, 1000);
		},
		
		methods: {
			async loginCode(code){
				const [err, res] = await api.loginCode({
						query: {
							code:code
						}
					 });
				 console.log(res)
				 if(res.data.code == 0){
					 let token=res.data.data
					 this.token=token
					 uni.setStorageSync('token', token);
					 this.myFans()
				 }else{
					 uni.showToast({
					 	title: res.data.msg,
					 	icon: 'none'
					 })
					if(res.data.code==100){
						uni.removeStorageSync('token');
						setTimeout(() => {
							uni.reLaunch({
							  url: "/pages/login/loginWechat"
							})
						}, 1000);
					}
				 }
			},
			async myFans(){
				const [err, res] = await api.myFans({
					 header:{
						'Content-Type': 'application/json',
						'token': this.token
					 }
				 });
				 if(res.data.code == 0){
					 this.myTeam=res.data.myTeam
					 this.fans_z=res.data.myTeam.bigNum+res.data.myTeam.middleNum+res.data.myTeam.smallNum+res.data.myTeam.generalNum+res.data.myTeam.touristNum;
					 this.group_z=res.data.myTeam.bigFans+res.data.myTeam.middleFans+res.data.myTeam.smallFans+res.data.myTeam.generalFans+res.data.myTeam.touristFans;
					 this.today_z=res.data.myTeam.todayBigFans+res.data.myTeam.todayMiddleFans+res.data.myTeam.todaySmallFans+res.data.myTeam.todayGeneralFans+res.data.myTeam.todayTouristFans;
					this.getFansForMonth()
				 }else{
					 uni.showToast({
					 	title: res.data.msg,
					 	icon: 'none'
					 })
					if(res.data.code==200){
						uni.removeStorageSync('token');
						setTimeout(() => {
							uni.reLaunch({
							  url: "/pages/login/loginWechat"
							})
						}, 1000);
					}
				 }
			},
			async getFansForMonth(){
				const [err, res] = await api.getFansForMonth({
					query: {
						date:this.mydate,
						isDirectly:1
					},
					 header:{
						'Content-Type': 'application/json',
						'token': this.token
					 }
				 });
				 if(res.data.code == 0){
					 let LineA={categories:[],series:[]};
					 //这里我后台返回的是数组，所以用等于，如果您后台返回的是单条数据，需要push进去
					 // LineA.categories=res.data.data.LineA.categories;
					 LineA.categories=res.data.data.dateList;
					 LineA.series=[{
						 name: '-总人数新增-',
						 data:res.data.data.allNumList ,
						 color: '#E93246'
					 },{
						 name: '-至尊VIP新增-',
						 data:res.data.data.bigNumList ,
						 color: '#0099FF'
					 },{
						 name: '-金尊VIP新增-',
						 data:res.data.data.middleNumList ,
						 color: '#039D56'
					 },{
						 name: '-银尊VIP新增-',
						 data:res.data.data.smallNumList ,
						 color: '#FCC133'
					 },{
						 name: '-VIP新增-',
						 data:res.data.data.generalNumList ,
						 color: '#5249CB'
					 },{
						 name: '-注册会员-',
						 data:res.data.data.touristNumList ,
						 color: '#DBC291'
					 }]
					 // _self.textarea = JSON.stringify(res.data.data.LineA);
					 _self.showLineA("canvasLineA",LineA);
				 }
			},
			showLineA(canvasId,chartData){
				canvaLineA=new uCharts({
					$this:_self,
					canvasId: canvasId,
					type: 'line',
					fontSize:11,
					padding:[15,15,0,15],
					legend:{
						show:true,
						padding:5,
						position:'top',
						lineHeight:11,
						margin:5,
					},
					dataLabel:true,
					dataPointShape:true,
					dataPointShapeType:'hollow',
					background:'#FFFFFF',
					pixelRatio:_self.pixelRatio,
					categories: chartData.categories,
					series: chartData.series,
					animation: true,
					enableScroll: true,//开启图表拖拽功能
					xAxis: {
						disableGrid:false,
						type:'grid',
						gridType:'dash',
						itemCount:15,
						scrollShow:true,
						scrollAlign:'left'
					},
					yAxis: {
						//disabled:true
						gridType:'dash',
						splitNumber:8,
						min:0,
						max:30,
						format:(val)=>{return val.toFixed(0)}//如不写此方法，Y轴刻度默认保留两位小数
					},
					width: _self.cWidth*_self.pixelRatio,
					height: _self.cHeight*_self.pixelRatio,
					extra: {
						line:{
							type: 'straight'
						}
					},
				});
				
			},
			touchLineA(e){
				canvaLineA.scrollStart(e);
			},
			moveLineA(e) {
				canvaLineA.scroll(e);
			},
			touchEndLineA(e) {
				canvaLineA.scrollEnd(e);
				//下面是toolTip事件，如果滚动后不需要显示，可不填写
				canvaLineA.touchLegend(e);
				canvaLineA.showToolTip(e, {
					format: function (item, category) {
						return category + ' ' + item.name + ':' + item.data 
					}
				});
			},
			//获取token与id
			getQueryVariable(variable)
			{
			       var query = window.location.search.substring(1);
			       var vars = query.split("&");
			       for (var i=0;i<vars.length;i++) {
			               var pair = vars[i].split("=");
			               if(pair[0] == variable){return pair[1];}
			       }
			       return(false);
			},
			GetQueryString(name){
			    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
			    var r = window.location.search.substr(1).match(reg);
			    if(r!=null)return  unescape(r[2]); return null;
			},
			//显示上级二维码大图
			shareShow(type){
				if(type==1){
					this.imgShow=true
					this.img=this.myTeam.invite.parentUserWeChatCode
				}else if(type==0){
					this.imgShow=true
					this.img=this.myTeam.weChatCode
				}
				
			},
			//隐藏上级二维码大图
			shareHide(){
				this.imgShow=false
			},
			fans(){
				if(this.fansFlag == true){
					uni.navigateTo({
					  url: "/pages/myGroup/myGroup?fansFlag=" + this.fansFlag
					})
				}else{
					uni.navigateTo({
					  url: "/pages/myGroup/myGroup"
					})
				}
			},
			//跳转小熊猫数据
			xiangqing(){
				uni.navigateTo({
				  url: "/pages/myFansDetail/myFansDetail"
				})
			},
			//跳转小熊猫变动
			biandong(mydate){
				uni.navigateTo({
				  url: "/pages/FansDetail/FansDetail?mydate="+mydate
				})
			},
			onClickItem(index) {
				if (this.current !== index) {
					this.current = index
				}
			}
		}
	}
</script>
